package internal;

import domain.entities.User;

import java.sql.Timestamp;

/**
 * 用户已登录信息
 * 用于将ws链接和用户进行关系绑定
 *
 * @author wyl
 */
public class UserLoggedInfo {
    User user;
    String connId;
    Timestamp loginTime;
    boolean isTaboo;

    public UserLoggedInfo(String connId, User user) {
        this.user = user;
        this.connId = connId;
        this.loginTime = new Timestamp(System.currentTimeMillis());
    }

    public User getUser() {
        return user;
    }

    public String getUserId() {
        return user.getId();
    }

    public Timestamp getLoginTime() {
        return loginTime;
    }

    public String getConnId() {
        return connId;
    }

    public String getIsTabooString() {
        return isTaboo ? "是" : "否";
    }

    public boolean getIsTaboo() {
        return isTaboo;
    }

    public void setTaboo(boolean isTaboo) {
        this.isTaboo = isTaboo;
    }
}
